{% extends 'bookcopy_base.html' %}
{% block links %}
  <h3 id="rr">Reserve/Rent</h3>
  {% if perms.baseapp.add_rental or perms.baseapp.add_reservation %}
      <div class="inner_menu">
        <ul>
            {% if perms.baseapp.add_rental %}        <li><a href='user/'>Reserve/rent for user</a></li>    {% endif %}
            {% if perms.baseapp.add_reservation %}   <li><a href='reserve/'>Reserve for me</a></li>        {% endif %}
            {% if perms.baseapp.change_bookcopy %}  <li><a href='edit/'>Edit</a></li>        {% endif %}
        </ul>
      </div>
  {% else %}
    <p>Lack of permissions</p>
  {% endif %}
{% endblock %}

{% block go_up %}
    <div class="goUpWrapper"><a href=up/>Up</a></div>
{% endblock %}

{% if user.userprofile.is_librarian %}
    {% block rent_return %}
        <form method='post' action='.'>
            {% if rental %}
                <input type='hidden' name='return' value='{{ rental.id }}'>
                <input type='submit' name='return_button' value='Return'>
            {% endif %}
            {# the following is never user for now. If someone wanted to implement renting from here - here you go #}
            {% if reservation %}
                <input type='hidden' name='rent' value='{{ reservation.id }}'>
                <input type='submit' name='rent_button' value='Rent'>
            {% endif %}
        </form>
    {% endblock rent_return %}
{% endif %}
